import request from '@/utils/request'

// 查询领用列表
export function listReceive(query) {
  return request({
    url: '/asset/receive/list',
    method: 'get',
    params: query
  })
}

// 查询领用详细
export function getReceive(id) {
  return request({
    url: '/asset/receive/' + id,
    method: 'get'
  })
}

// 新增领用
export function addReceive(data) {
  return request({
    url: '/asset/receive',
    method: 'post',
    data: data
  })
}

// 修改领用
export function updateReceive(data) {
  return request({
    url: '/asset/receive',
    method: 'put',
    data: data
  })
}

// 删除领用
export function delReceive(id) {
  return request({
    url: '/asset/receive/' + id,
    method: 'delete'
  })
}

// 查询资产列表列表
export function listAsset(query) {
  return request({
    url: '/asset/asset/listIdle',
    method: 'get',
    params: query
  })
}

// 查询部门下拉树结构
export function deptTreeSelect() {
  return request({
    url: '/system/user/deptTree',
    method: 'get'
  })
}


// 更新资产领用人
export function updateAssetRecipient(assetCode, recipient) {
  return request({
    url: '/asset/asset/receive/' + assetCode + recipient,
    method: 'get'
  })
}

